Research
Security News
Kill Switch Hidden in npm Packages Typosquatting Chalk and Chokidar
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
Provide a high level wrapper for kuromoji.js.
npm install kuromojin
Export two API.
getTokenizer()
return Promise
that is resolved with kuromoji.js's tokenizer
instance.kuromojin as default
return Promise
that is resolved with analyzed text.import {tokenize, getTokenizer} from "kuromojin";
getTokenizer().then(tokenizer => {
// kuromoji.js's `tokenizer` instance
});
tokenize(text).then(results => {
console.log(results)
/*
[ {
word_id: 509800, // 辞書内での単語ID
word_type: 'KNOWN', // 単語タイプ(辞書に登録されている単語ならKNOWN, 未知語ならUNKNOWN)
word_position: 1, // 単語の開始位置
surface_form: '黒文字', // 表層形
pos: '名詞', // 品詞
pos_detail_1: '一般', // 品詞細分類1
pos_detail_2: '*', // 品詞細分類2
pos_detail_3: '*', // 品詞細分類3
conjugated_type: '*', // 活用型
conjugated_form: '*', // 活用形
basic_form: '黒文字', // 基本形
reading: 'クロモジ', // 読み
pronunciation: 'クロモジ' // 発音
} ]
*/
});
If window.kuromojin.dicPath
is defined, kuromojin use it as default dict path.
import {tokenize} from "kuromojin";
// Affect all module that are used kuromojin.
window.kuromojin = {
dicPath: "https://example.com/kuromoji/dict"
};
// this `getTokenizer` function use "https://example.com/kuromoji/dict"
getTokenizer();
// ===
getTokenizer({dicPath: "https://example.com/kuromoji/dict"})
kuromojin v1.1.0 export tokenize
as default function
import kuromojin from "kuromojin";
// kuromojin === tokenize
Recommended use import {tokenize} from "kuromojin"
instead of it
import {tokenize} from "kuromojin";
npm test
git checkout -b my-new-feature
git commit -am 'Add some feature'
git push origin my-new-feature
MIT
FAQs
Provide a high level wrapper for kuromoji.js
The npm package kuromojin receives a total of 46,977 weekly downloads. As such, kuromojin popularity was classified as popular.
We found that kuromojin demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.